//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
/*
** INTEL CONFIDENTIAL
** Copyright 2000-2003 Intel Corporation All Rights Reserved.
**
** The source code contained or described herein and all documents
** related to the source code (Material) are owned by Intel Corporation
** or its suppliers or licensors.  Title to the Material remains with
** Intel Corporation or its suppliers and licensors. The Material contains
** trade secrets and proprietary and confidential information of Intel
** or its suppliers and licensors. The Material is protected by worldwide
** copyright and trade secret laws and treaty provisions. No part of the
** Material may be used, copied, reproduced, modified, published, uploaded,
** posted, transmitted, distributed, or disclosed in any way without Intel
** prior express written permission.
** No license under any patent, copyright, trade secret or other intellectual
** property right is granted to or conferred upon you by disclosure or
** delivery of the Materials, either expressly, by implication, inducement,
** estoppel or otherwise. Any license under such intellectual property rights
** must be express and approved by Intel in writing.
*/

/*++

Module Name:  INTCBits.h

Abstract:
  Contains macro definitions for Enabling/Disabling (UnMasking/Masking)
  interrupts at the Interrupt Controller on Bulverde

Functions:


Notes:

--*/

#ifndef __INTCBits_H__
#define __INTCBits_H__
///////////////////////////////////////////////////////////////////////////////

#include "xllp_intc.h"

#define ICCR_DIM    0x01  // DIM - Set to exit Idle for only unmasked ints

//
// Mask/Unmask RTC interrupts
//
#define INTC_AL_INT_EN(pINTC)          (pINTC |= XLLP_INTC_RTCALARM)    // Alarm
#define INTC_AL_INT_DIS(pINTC)         (pINTC &= ~XLLP_INTC_RTCALARM)

#define INTC_RTC_TIC_INT_EN(pINTC)     (pINTC |= XLLP_INTC_RTCALARM)    // 1 Hz Tic
#define INTC_RTC_TIC_INT_DIS(pINTC)    (pINTC &= ~XLLP_INTC_RTCALARM)

//
// Mask/Unmask OST Match Register 0-3 interrupts
//
#define INTC_M3_INT_EN(pINTC)          (pINTC |= XLLP_INTC_OSMR3)
#define INTC_M3_INT_DIS(pINTC)         (pINTC &= ~XLLP_INTC_OSMR3)

#define INTC_M2_INT_EN(pINTC)          (pINTC |= XLLP_INTC_OSMR2)
#define INTC_M2_INT_DIS(pINTC)         (pINTC &= ~XLLP_INTC_OSMR2)

#define INTC_M1_INT_EN(pINTC)          (pINTC |= XLLP_INTC_OSMR1)
#define INTC_M1_INT_DIS(pINTC)         (pINTC &= ~XLLP_INTC_OSMR1)

#define INTC_M0_INT_EN(pINTC)          (pINTC |= XLLP_INTC_OSMR0)
#define INTC_M0_INT_DIS(pINTC)         (pINTC &= ~XLLP_INTC_OSMR0)

//
// Mask/Unmask DMAC Ints
//
#define INTC_DMAC_INT_EN(pINTC)        (pINTC |= XLLP_INTC_DMAC)
#define INTC_DMAC_INT_DIS(pINTC)       (pINTC &= ~XLLP_INTC_DMAC)

//
// Mask/Unmask SSP Ints
//
#define INTC_SSP_INT_EN(pINTC)         (pINTC |= XLLP_INTC_SSP)
#define INTC_SSP_INT_DIS(pINTC)        (pINTC &= ~XLLP_INTC_SSP)

//
// Mask/Unmask MMC Ints
//
#define INTC_MMC_INT_EN(pINTC)         (pINTC |= XLLP_INTC_MMC)
#define INTC_MMC_INT_DIS(pINTC)        (pINTC &= ~XLLP_INTC_MMC)

//
// Mask/Unmask UART Ints
//
#define INTC_FFUART_INT_EN(pINTC)      (pINTC |= XLLP_INTC_FFUART)
#define INTC_FFUART_INT_DIS(pINTC)     (pINTC &= ~XLLP_INTC_FFUART)

#define INTC_BTUART_INT_EN(pINTC)      (pINTC |= XLLP_INTC_BTUART)
#define INTC_BTUART_INT_DIS(pINTC)     (pINTC &= ~XLLP_INTC_BTUART)

#define INTC_STUART_INT_EN(pINTC)      (pINTC |= XLLP_INTC_STUART)
#define INTC_STUART_INT_DIS(pINTC)     (pINTC &= ~XLLP_INTC_STUART)

//
// Mask/Unmask ICP Ints
//
#define INTC_ICP_INT_EN(pINTC)         (pINTC |= XLLP_INTC_ICP)
#define INTC_ICP_INT_DIS(pINTC)        (pINTC &= ~XLLP_INTC_ICP)

//
// Mask/Unmask I2C Ints
//
#define INTC_I2C_INT_EN(pINTC)         (pINTC |= XLLP_INTC_I2C)
#define INTC_I2C_INT_DIS(pINTC)        (pINTC &= ~XLLP_INTC_I2C)

//
// Mask/Unmask LCD Ints
//
#define INTC_LCD_INT_EN(pINTC)         (pINTC |= XLLP_INTC_LCD)
#define INTC_LCD_INT_DIS(pINTC)        (pINTC &= ~XLLP_INTC_LCD)

//
// Mask/Unmask SSP2 Ints
//
#define INTC_SSP2_INT_EN(pINTC)         (pINTC |= XLLP_INTC_SSP2)
#define INTC_SSP2_INT_DIS(pINTC)        (pINTC &= ~XLLP_INTC_SSP2)

//
// Mask/Unmask USIM (SmartCard) Ints
//
#define INTC_USIM_INT_EN(pINTC)         (pINTC |= XLLP_INTC_USIM)
#define INTC_USIM_INT_DIS(pINTC)        (pINTC &= ~XLLP_INTC_USIM)

//
// Mask/Unmask AC97 Ints
//
#define INTC_AC97_INT_EN(pINTC)        (pINTC |= XLLP_INTC_AC97)
#define INTC_AC97_INT_DIS(pINTC)       (pINTC &= ~XLLP_INTC_AC97)

//
// Mask/Unmask I2S Ints
//
#define INTC_I2S_INT_EN(pINTC)         (pINTC |= XLLP_INTC_I2S)
#define INTC_I2S_INT_DIS(pINTC)        (pINTC &= ~XLLP_INTC_I2S)

//
// Mask/Unmask PMU Ints
//
#define INTC_PMU_INT_EN(pINTC)         (pINTC |= XLLP_INTC_PMU)
#define INTC_PMU_INT_DIS(pINTC)        (pINTC &= ~XLLP_INTC_PMU)

//
// Mask/Unmask USB Client Ints
//
#define INTC_USBC_INT_EN(pINTC)         (pINTC |= XLLP_INTC_USBCLIENT)
#define INTC_USBC_INT_DIS(pINTC)        (pINTC &= ~XLLP_INTC_USBCLIENT)

//
// Mask/Unmask GPIO Ints
//
#define INTC_GPIOXX_2_INT_EN(pINTC)    (pINTC |= XLLP_INTC_GPIOXX_2)
#define INTC_GPIOXX_2_INT_DIS(pINTC)   (pINTC &= ~XLLP_INTC_GPIOXX_2)

#define INTC_GPIO1_INT_EN(pINTC)       (pINTC |= XLLP_INTC_GPIO1)
#define INTC_GPIO1_INT_DIS(pINTC)      (pINTC &= ~XLLP_INTC_GPIO1)

#define INTC_GPIO0_INT_EN(pINTC)       (pINTC |= XLLP_INTC_GPIO0)
#define INTC_GPIO0_INT_DIS(pINTC)      (pINTC &= ~XLLP_INTC_GPIO0)

//
// Mask/Unmask OST Match Registers M4-11 Ints
//
#define INTC_M4XX_INT_EN(pINTC)          (pINTC |= XLLP_INTC_OSMRXX_4)
#define INTC_M4XX_INT_DIS(pINTC)         (pINTC &= ~XLLP_INTC_OSMRXX_4)

//
// Mask/Unmask Power I2C Ints
//
#define INTC_PWRI2C_INT_EN(pINTC)         (pINTC |= XLLP_INTC_PWRI2C)
#define INTC_PWRI2C_INT_DIS(pINTC)        (pINTC &= ~XLLP_INTC_PWRI2C)

//
// Mask/Unmask MEM Stick Ints
//
#define INTC_MEMSTICK_INT_EN(pINTC)         (pINTC |= XLLP_INTC_MEMSTICK)
#define INTC_MEMSTICK_INT_DIS(pINTC)        (pINTC &= ~XLLP_INTC_MEMSTICK)

//
// Mask/Unmask Keypad Ints
//
#define INTC_KEYPAD_INT_EN(pINTC)      (pINTC |= XLLP_INTC_KEYPAD)
#define INTC_KEYPAD_INT_DIS(pINTC)     (pINTC &= ~XLLP_INTC_KEYPAD)

//
// Mask/Unmask USB Host OHCI Ints
//
#define INTC_USBOHCI_INT_EN(pINTC)         (pINTC |= XLLP_INTC_USBOHCI)
#define INTC_USBOHCI_INT_DIS(pINTC)        (pINTC &= ~XLLP_INTC_USBOHCI)

//
// Mask/Unmask USB Host OHCI Ints, errors, power, misc events.
//
#define INTC_USBNONOHCI_INT_EN(pINTC)         (pINTC |= XLLP_INTC_USBNONOHCI)
#define INTC_USBNONOHCI_INT_DIS(pINTC)        (pINTC &= ~XLLP_INTC_USBNONOHCI)

//
// Mask/Unmask Baseband Ints
//
#define INTC_BASEBAND_INT_EN(pINTC)      (pINTC |= XLLP_INTC_BASEBAND)
#define INTC_BASEBAND_INT_DIS(pINTC)     (pINTC &= ~XLLP_INTC_BASEBAND)

//
// Mask/Unmask SSP3 Ints
//
#define INTC_SSP3_INT_EN(pINTC)         (pINTC |= XLLP_INTC_SSP3)
#define INTC_SSP3_INT_DIS(pINTC)        (pINTC &= ~XLLP_INTC_SSP3)

//
// Mask/Unmask TPM Ints
//
#define INTC_TPM_INT_EN(pINTC)          (pINTC |= XLLP_INTC_TPM)
#define INTC_TPM_INT_DIS(pINTC)         (pINTC &= ~XLLP_INTC_TPM)

//
// Mask/Unmask CAPTURE Ints
//
#define INTC_CAPTURE_INT_EN(pINTC)      (pINTC |= XLLP_INTC_CAPTURE)
#define INTC_CAPTURE_INT_DIS(pINTC)     (pINTC &= ~XLLP_INTC_CAPTURE)

///////////////////////////////////////////////////////////////////////////////
#endif
